// pages/dashboard/dashboard.js
Page({

  fn1() {
    this.text = '我的天'

    var that = this

    wx.getLocation({
      type: 'wgs84', // 
      success(res) {
        // 成功的回调
        console.log('this.text', that.text)
        console.log('res', res)
        var latitude = res.latitude // 纬度
        var longitude = res.longitude // 经度
      },
      fail: (error) => {
        // 失败的回调
        console.log('失败', error)
      },
      complete: () => {
        // 不管成功还是失败都会触发的回调
        console.log('complete')
      }
    })
  },

  fn2() {
    wx.scanCode({
      success: (res) => {
        console.log('扫一扫成功', res)
      }
    })
  }
})